<?php
/**
 * beimuaihui System
 * Copyright(c) 2011-2020 beimuaihui.
 * @license    http://www.gnu.org/licenses/gpl.html     This software Under GPL V3 License 
 * beimuaihui@gmail.com
 * http://code.google.com/p/beimuaihui/
 * $Id: TranslatearrayController.php 197 2011-02-18 12:45:33Z beimuaihui $
 */



class Multilang_TranslatearrayController extends Baogg_Controller_Action {

	function init() {
	    Zend_Loader::loadClass ( 'TranslateArray' );
		$this->translateArray = new TranslateArray ( );
		
		Zend_Loader::loadClass ( 'Language' );
		$this->language = new Language ( );
		
		Zend_Loader::loadClass ( 'TranslateContent' );
        $this->translateContent = new TranslateContent ( );

	}

	/**
	 * The default action
	 */
	public function editAction() 
	{
		global $LANG;
		
		$translate_var_pid=(int)$this->getRequest()->getParam('translate_var_pid');

		$objVar=new TranslateVar();
		//echo $translate_var_pid;exit;
		$rs_var=$objVar->getOne($translate_var_pid);
		$menu_ids=array(0,(int)$rs_var[0]['menu_id']);
		$where['a.menu_id  in ']="(".implode(",",$menu_ids).')';
		$rs_vars=$this->translateContent->getList($where);
		$store_translate_var_id=array();
		foreach((array)$rs_vars as $k=>$v)
		{
			$store_translate_var_id=array($v['translate_var_id'],$v['content']);
		}
		
		$rs_array=$this->translateArray->getList(array("translate_var_pid"=>$translate_var_pid));
		$this->view->store_translate_var_id=Zend_Json::encode($store_translate_var_id);
		$this->view->rs_array=Zend_Json::encode($rs_array);
		$this->view->LANG=$LANG;
		$this->view_translate_var_pid=$translate_var_pid;
		
	}

}
